package io;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Demo3 {
public static void main(String[] args) throws IOException {
    File file = new File("d:/test.txt");
    file.createNewFile();
    System.out.println("创建文件成功");
    //进程推出才会删除
   file.deleteOnExit();
   System.out.println("使用deleteOnExit");
  Scanner sc = new Scanner(System.in);
  System.out.println( "输入任意内容，退出程序");
  sc.next();
}
}
